<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    //预解析 var类型声名提升到Javascript第一行  function在之后
    console.log(num);
    var num = 8;
    init()
    function init() {
      console.log(11111);
    }
    fun()//报错 fun不是一个函数
    var fun = function () {
      console.log(222222);
    }
  </script>
</body>

</html>